package com.iamback.dy.examine.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.iamback.dy.entity.DyuserBlocked;
import com.iamback.dy.examine.service.IDyuserBlockedService;
import com.iamback.dy.mapper.DyuserBlockedMapper;

@Service
public class DyuserBlockedServiceImpl implements IDyuserBlockedService {
	@Autowired
	private DyuserBlockedMapper dyuserBlockedDao;

	@Override
	public List<DyuserBlocked> findDyuserBlocked(String  dyId, Integer numPerPage) {
		Map<String , Object> map =new HashMap<String, Object>();
		map.put("dyId", dyId);
		map.put("numPerPage", numPerPage);
		return dyuserBlockedDao.findDyuserBlocked(map);
	}

	@Override
	public DyuserBlocked findDyuserBlockedByOne(String dyId) {
		 List<DyuserBlocked>   dyuserBlockeds = findDyuserBlocked(dyId ,1);
		 if(dyuserBlockeds!=null&&!dyuserBlockeds.isEmpty()){
			 return dyuserBlockeds.get(0);
		 }
		 return null;
	}

	@Override
	public void saveDyuserBlocked(DyuserBlocked dyuserBlocked) {
		dyuserBlockedDao.saveDyuserBlocked(dyuserBlocked);
	}

}
